// One * is the opposite of &. Also, one * erases one &.
fn main() {
    {
        let mut my_number = 8;
        let num_ref = &mut my_number;
        // Use * to change the i32 value.
        *num_ref += 10;
        println!("{}", my_number);

        let second_number = 800;
        let triple_reference = &&&second_number;
        println!(
            "Second_number = triple_reference? {}",
            second_number == ***triple_reference
        );
    }

    println!();

    {
        let mut number = 10;
        // Create a mutable reference.
        let number_change = &mut number;
        // Use the mutable reference to add 10.
        *number_change += 10;
        // Create an immutable reference.
        let number_ref = &number;
        // Print the immutable reference.
        println!("{}", number_ref);
    }

    println!();

    {
        // Now we have a String called country.
        let country = String::from("Austria");
        // country_ref is a reference to this data. It's not going to change.
        let country_ref = &country;
        // Now we have a variable called country that is an i8. But it has no
        // relation to the other one, or to country_ref
        let country = 8;
        // country_ref still refers to the data of String::from("Austria") that
        // we gave it.
        println!("{}, {}", country_ref, country);
    }
}
